##
# HTH Makefile
#
# Hth's TCP hijacker
#
# www.unix-junkies.org
#

# Project name
NAME		=	flowinsert


# Source files
SRCS		=	flowinsert.c options.c hijack.c common.c network.c


# Object files
OBJS		=	flowinsert.o options.o hijack.o common.o network.o

# Flags for compiler and linker
CFLAGS		+=
LDFLAGS		+=

# Include dir
INCLUDES	+=
# Libraries directory
LIBSDIR		+=
# Libraries to link
LIBS		+=



###############################################################
# Required commands
CC	= gcc
RM	= rm -f

INCLUDES	+=	-I./includes -I/usr/include -I/usr/local/include
LIIBFOLDERS	+=	-L/usr/lib
LIBS		+=	-lpcap

STATIC		=	
CFLAGS		+=	-Wall -pedantic -g -pipe $(INCLUDES) -D_FORTIFY_SOURCE=2 -DDEBUG
LDFLAGS		+=	$(LIBFOLDERS) $(LIBS) $(STATIC)


$(NAME): $(OBJS)
	$(CC) -o $(NAME) $(OBJS) $(LDFLAGS)

all: $(NAME)

.c.o:
	$(CC) $(CFLAGS) -c  $< -o $@

# User can choose to statically link the executable typing make static
static:
	$(MAKE) STATIC=-static

clean:
	$(RM) $(OBJS)

distclean: clean
	$(RM) $(NAME)

rebuild: distclean all

.PHONY: clean distclean rebuild static

